home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
6
/
cl0588.zip
/
GETCH.C
< prev
next >
Wrap
Text File
|
1988-01-21
|
372b
|
24 lines
/* .subt | Get and save character routines for desktop calculator */
#define BUFSIZE 100
char buf[BUFSIZE];
int bufp = 0;
getch()
{
return((bufp > 0) ? buf[--bufp] : getchar());
}
ungetch(c)
int c;
{
if (bufp > BUFSIZE)
printf("ungetch: too many characters\n");
else
buf[bufp++] = c
}
/* .subt < end of file, file getch.c */